<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Axios配置</title>
	</head>
	<body>
		
		<h1>远程Ajax测试</h1>
		<script src="../js/axios.js"></script>
		<script>
			//配置基本请求路径
			axios.defaults.baseURL = "http://localhost:8080/"
			//设定请求头信息
			axios.defaults.headers['mytoken'] = 'token-123456'
			
			axios.get("/getJSON")
					 .then(result => {
						 console.log(result.data)
					 })
		</script>
	</body>
</html>
